package com.wxd.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guigu.mapper.TGetserialMapper;
import com.guigu.mapper.TSportsItemLibraryMapper;
import com.guigu.pojo.TMeals;
import com.guigu.pojo.TSportsItemLibrary;
import com.lc.util.Getserial;
import com.wxd.service.TSportsService;
import com.wxd.vo.PageVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TSportsServiceImpl implements TSportsService {
    @Resource
    TSportsItemLibraryMapper tSportsItemLibraryMapper;

    @Resource
    private Getserial getserial;

    @Resource
    private TGetserialMapper tGetserialMapper;

    @Override
    public PageInfo<TSportsItemLibrary> TSportsQuery(PageVo<TSportsItemLibrary> pageVo) {
        PageHelper.startPage(pageVo.getPage(),pageVo.getPageSize());
        PageInfo<TSportsItemLibrary> dd=new PageInfo<TSportsItemLibrary>(this.tSportsItemLibraryMapper.tSportsQuery(pageVo.getEntityClass()));
        return dd;
    }

//    @Override
//    public PageInfo<TSportsItemLibrary> PaginationQuery(PageVo pageVo) {
//        PageHelper.startPage(pageVo.getPage(),pageVo.getPageSize());
//        List<TSportsItemLibrary> bate=tSportsItemLibraryMapper.paginationQuery((TSportsItemLibrary) pageVo.getEntityClass());
//        PageInfo<TSportsItemLibrary> pp=new PageInfo<TSportsItemLibrary>(bate);
//        return pp;
//    }

    @Override
    public void Insert(TSportsItemLibrary tSportsItemLibrary) {
        tSportsItemLibrary.setCode(this.getserial.returnYDid());
        this.tSportsItemLibraryMapper.insert(tSportsItemLibrary);
    }

    @Override
    public void UpdateByPrimaryKey(TSportsItemLibrary tSportsItemLibrary) {
        this.tSportsItemLibraryMapper.updateByPrimaryKey(tSportsItemLibrary);
    }

    @Override
    public void deleteByPrimaryKey(TSportsItemLibrary tSportsItemLibrary) {
        this.tSportsItemLibraryMapper.deleteByPrimaryKey(tSportsItemLibrary);
    }
}
